USE Liberty
GO

---------------------------------------------------------------------------------------------------
--	MilitaryRanks Population Script
--	Information Source:
--		http://www.defenselink.mil/specials/insignias/officers.html
--		http://www.defenselink.mil/specials/insignias/enlisted.html
---------------------------------------------------------------------------------------------------

SET NOCOUNT ON 

DECLARE @branch	bigint

IF EXISTS(SELECT 1 FROM dbo.MilitaryRanks)
BEGIN
	PRINT 'MilitaryRanks has been populated; bypassing population'
END
ELSE
BEGIN
	----USMC
	SELECT @branch = OID FROM dbo.TypesOfMilitaryBranch WHERE Branch = 'Marine Corps'

	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Enlisted', 'Private', 'E-1', 'Pvt', 1)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Enlisted', 'Private First Class', 'E-2', 'PFC', 2)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Enlisted', 'Lance Corporal', 'E-3', 'LCpl', 3)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Noncommissioned Officer', 'Corporal', 'E-4', 'Cpl', 4)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Noncommissioned Officer', 'Sergeant', 'E-5', 'Sgt', 5)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Staff Noncommissioned Officer', 'Staff Sergeant', 'E-6', 'SSgt', 6)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Staff Noncommissioned Officer', 'Gunnery Sergeant', 'E-7', 'GySgt', 7)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Staff Noncommissioned Officer', 'Master Sergeant', 'E-8', 'MSgt', 8)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Staff Noncommissioned Officer', 'First Sergeant', 'E-8', '1stSgt', 9)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Staff Noncommissioned Officer', 'Master Gunnery Sergeant', 'E-9', 'MGySgt', 10)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Staff Noncommissioned Officer', 'Sergeant Major', 'E-9', 'SgtMaj', 11)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Senior Enlisted', 'Sergeant Major of the Marine Corps', 'E-9', 'SgtMajMC', 12)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Warrant Officer', 'Chief Warrant Officer-5', 'W-5', 'CWO-5', 13)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Warrant Officer', 'Chief Warrant Officer-4', 'W-4', 'CWO-4', 14)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Warrant Officer', 'Chief Warrant Officer-3', 'W-3', 'CWO-3', 15)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Warrant Officer', 'Chief Warrant Officer-2', 'W-2', 'CWO-2', 16)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Warrant Officer', 'Warrant Officer-1', 'W-1', 'WO-1', 17)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Company-grade Officer', 'Second Lieutenant', 'O-1', '2ndLt', 18)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Company-grade Officer', 'First Lieutenant', 'O-2', '1stLt', 19)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Company-grade Officer', 'Captain', 'O-3', 'Capt', 20)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Field-grade Officer', 'Major', 'O-4', 'Maj', 21)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Field-grade Officer', 'Lieutenant Colonel', 'O-5', 'LtCol', 22)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Field-grade Officer', 'Colonel', 'O-6', 'Col', 23)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'General', 'Brigadier General', 'O-7', 'BGen', 24)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'General', 'Major General', 'O-8', 'MajGen', 25)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'General', 'Lieutenant General', 'O-9', 'LtGen', 26)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'General', 'General', 'O-10', 'Gen', 27)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'General', 'Commandant of the Marine Corps', 'O-10', 'Gen', 28)

	----Navy
	SELECT @branch = OID FROM dbo.TypesOfMilitaryBranch WHERE Branch = 'Navy'

	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Enlisted', 'Seaman Recruit', 'E-1', 'SR', 1)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Enlisted', 'Seaman Apprentice', 'E-2', 'SA', 2)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Enlisted', 'Seaman', 'E-3', 'SN', 3)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Petty Officer', 'Petty Officer Third Class', 'E-4', 'PO3', 4)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Petty Officer', 'Petty Officer Second Class', 'E-5', 'PO2', 5)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Petty Officer', 'Petty Officer First Class', 'E-6', 'PO1', 6)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Petty Officer', 'Chief Petty Officer', 'E-7', 'CPO', 7)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Petty Officer', 'Senior Chief Petty Officer', 'E-8', 'SCPO', 8)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Petty Officer', 'Master Chief Petty Officer', 'E-9', 'MCPO', 9)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Petty Officer', 'Fleet/Command Master Chief Petty Officer', 'E-9', '--', 10)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Senior Enlisted', 'Master Chief Petty Officer of the Navy', 'E-9', 'MCPON', 11)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Warrant Officer', 'Warrant Officer 1', 'W1', 'WO1', 12)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Warrant Officer', 'Chief Warrant Officer 2', 'W2', 'CWO2', 13)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Warrant Officer', 'Chief Warrant Officer 3', 'W3', 'CWO3', 14)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Warrant Officer', 'Chief Warrant Officer 4', 'W4', 'CWO4', 15)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Warrant Officer', 'Chief Warrant Officer', 'W5', 'CWO5', 16)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Junior-grade Officer', 'Ensign', 'O-1', 'ENS', 17)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Junior-grade Officer', 'Lieutenant Junior Grade', 'O-2', 'LTJG', 18)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Junior-grade Officer', 'Lieutenant', 'O-3', 'LT', 19)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Mid-grade Officer', 'Lieutenant Commander', 'O-4', 'LCDR', 20)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Mid-grade Officer', 'Commander', 'O-5', 'CDR', 21)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Mid-grade Officer', 'Captain', 'O-6', 'CAPT', 22)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Flag Officer', 'Rear Admiral Lower Half', 'O-7', 'RADM (LH)', 23)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Flag Officer', 'Rear Admiral Upper Half', 'O-8', 'RADM (UH)', 24)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Flag Officer', 'Vice Admiral', 'O-9', 'VADM', 25)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Flag Officer', 'Admiral', 'O-10', 'ADM', 26)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Flag Officer', 'Admiral - Chief of Naval Operations', 'O-10', 'ADMCNO', 27)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Flag Officer', 'Fleet Admiral', 'O-11', 'FA', 28)

	----Army
	SELECT @branch = OID FROM dbo.TypesOfMilitaryBranch WHERE Branch = 'Army'

	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Private', 'Private', 'E-1', 'PV1', 1)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Private', 'Private', 'E-2', 'PV2', 2)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Private', 'Private First Class', 'E-3', 'PFC', 3)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Noncommissioned Officer', 'Specialist', 'E-4', 'SPC', 4)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Noncommissioned Officer', 'Corporal', 'E-4', 'CPL', 5)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Noncommissioned Officer', 'Sergeant', 'E-5', 'SGT', 6)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Noncommissioned Officer', 'Staff Sergeant', 'E-6', 'SSG', 7)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Noncommissioned Officer', 'Sergeant First Class', 'E-7', 'SFC', 8)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Noncommissioned Officer', 'Master Sergeant', 'E-8', 'MSG', 9)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Noncommissioned Officer', 'First Sergeant', 'E-8', '1SG', 10)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Noncommissioned Officer', 'Sergeant Major', 'E-9', 'SGM', 11)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Noncommissioned Officer', 'Command Sergeant Major', 'E-9', 'CSM', 12)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Senior Enlisted', 'Sergeant Major of the Army', 'E-9', 'SMA', 13)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Warrant Officer', 'Warrant Officer 1', 'W1', 'WO1', 14)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Warrant Officer', 'Chief Warrant Officer 2', 'W2', 'CW2', 15)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Warrant Officer', 'Chief Warrant Officer 3', 'W3', 'CW3', 16)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Warrant Officer', 'Chief Warrant Officer 4', 'W4', 'CW4', 17)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Warrant Officer', 'Chief Warrant Officer 5', 'W5', 'CW5', 18)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Company-grade Officer', 'Second Lieutenant', 'O-1', '2LT', 19)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Company-grade Officer', 'First Lieutenant', 'O-2', '1LT', 20)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Company-grade Officer', 'Captain', 'O-3', 'CPT', 21)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Field-grade Officer', 'Major', 'O-4', 'MAJ', 22)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Field-grade Officer', 'Lieutenant Colonel', 'O-5', 'LTC', 23)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Field-grade Officer', 'Colonel', 'O-6', 'COL', 24)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'General', 'Brigadier General', 'O-7', 'BG', 25)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'General', 'Major General', 'O-8', 'MG', 26)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'General', 'Lieutenant General', 'O-9', 'LTG', 27)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'General', 'General', 'O-10', 'GEN', 28)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'General', 'Army Chief of Staff', 'O-10', 'ACS', 29)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'General', 'General of the Army', 'O-11', 'GA', 30)

	----Air Force
	SELECT @branch = OID FROM dbo.TypesOfMilitaryBranch WHERE Branch = 'Air Force'

	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Enlisted', 'Airman Basic', 'E-1', 'AB', 1)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Enlisted', 'Airman ', 'E-2', 'AMN', 2)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Enlisted', 'Airman First Class', 'E-3', 'A1C', 3)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Enlisted', 'Senior Airman', 'E-4', 'SRA', 4)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Noncommissioned Officer', 'Staff Sergeant', 'E-5', 'SSGT', 5)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Noncommissioned Officer', 'Technical Sergeant', 'E-6', 'TSGT', 6)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Noncommissioned Officer', 'Master Sergeant', 'E-7', 'MSGT', 7)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Noncommissioned Officer', 'First Sergeant', 'E-7', 'FSGT', 8)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Noncommissioned Officer', 'First Sergeant', 'E-8', 'FSGT', 9)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Noncommissioned Officer', 'Senior Master Sergeant', 'E-8', 'SMSGT', 10)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Noncommissioned Officer', 'First Sergeant', 'E-9', 'FSGT', 11)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Noncommissioned Officer', 'Chief Master Sergeant', 'E-9', 'CMSGT', 12)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Noncommissioned Officer', 'Command Chief Master Sergeant', 'E-9', 'CCM', 13)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Senior Enlisted', 'Chief Master Sergeant of the Air Force', 'E-9', 'CMSAF', 14)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Company-grade Officer', 'Second Lieutenant', 'O-1', '2ndLt', 15)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Company-grade Officer', 'First Lieutenant', 'O-2', '1stLt', 16)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Company-grade Officer', 'Captain', 'O-3', 'Capt', 17)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Field-grade Officer', 'Major', 'O-4', 'Maj', 18)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Field-grade Officer', 'Lieutenant Colonel', 'O-5', 'LtCol', 19)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Field-grade Officer', 'Colonel', 'O-6', 'Col', 20)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'General', 'Brigadier General', 'O-7', 'BGen', 21)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'General', 'Major General', 'O-8', 'MajGen', 22)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'General', 'Lieutenant General', 'O-9', 'LtGen', 23)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'General', 'General', 'O-10', 'Gen', 24)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'General', 'Air Force Chief of Staff', 'O-10', 'AFCS', 25)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'General', 'General of the Air Force', 'O-11', 'GAF', 26)

	----Coast Guard
	SELECT @branch = OID FROM dbo.TypesOfMilitaryBranch WHERE Branch = 'Coast Guard'

	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Enlisted', 'Seaman Recruit', 'E-1', 'SR', 1)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Enlisted', 'Seaman Apprentice', 'E-2', 'SA', 2)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Enlisted', 'Seaman', 'E-3', 'SN', 3)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Petty Officer', 'Petty Officer Third Class', 'E-4', 'PO3', 4)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Petty Officer', 'Petty Officer Second Class', 'E-5', 'PO2', 5)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Petty Officer', 'Petty Officer First Class', 'E-6', 'PO1', 6)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Petty Officer', 'Chief Petty Officer', 'E-7', 'CPO', 7)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Petty Officer', 'Senior Chief Petty Officer', 'E-8', 'SCPO', 8)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Petty Officer', 'Master Chief Petty Officer', 'E-9', 'MCPO', 9)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Petty Officer', 'Fleet/Command Master Chief Petty Officer', 'E-9', '--', 10)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Senior Enlisted', 'Master Chief Petty Officer of the Coast Guard', 'E-9', 'MCPOCG', 11)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Warrant Officer', 'Warrant Officer 1', 'W1', 'WO1', 12)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Warrant Officer', 'Chief Warrant Officer 2', 'W2', 'CWO2', 13)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Warrant Officer', 'Chief Warrant Officer 3', 'W3', 'CWO3', 14)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Warrant Officer', 'Chief Warrant Officer 4', 'W4', 'CWO4', 15)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Warrant Officer', 'Chief Warrant Officer', 'W5', 'CWO5', 16)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Junior-grade Officer', 'Ensign', 'O-1', 'ENS', 17)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Junior-grade Officer', 'Lieutenant Junior Grade', 'O-2', 'LTJG', 18)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Junior-grade Officer', 'Lieutenant', 'O-3', 'LT', 19)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Mid-grade Officer', 'Lieutenant Commander', 'O-4', 'LCDR', 20)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Mid-grade Officer', 'Commander', 'O-5', 'CDR', 21)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Mid-grade Officer', 'Captain', 'O-6', 'CAPT', 22)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Flag Officer', 'Rear Admiral Lower Half', 'O-7', 'RADM (LH)', 23)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Flag Officer', 'Rear Admiral Upper Half', 'O-8', 'RADM (UH)', 24)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Flag Officer', 'Vice Admiral', 'O-9', 'VADM', 25)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Flag Officer', 'Admiral', 'O-10', 'ADM', 26)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Flag Officer', 'Admiral - Commandant of the Coast Guard', 'O-10', 'ADMCCG', 27)
	INSERT INTO dbo.MilitaryRanks (BranchOfServiceID, RankStructure, Rank, PayGrade, Abbreviation, DisplayOrder)
	VALUES(@branch, 'Flag Officer', 'Fleet Admiral', 'O-11', 'FA', 28)

	PRINT 'MilitaryRanks has been populated'
END


SELECT * FROM dbo.MilitaryRanks
